<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm  */

$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
	'Login',
    );

$baseUrl = Yii::app()->baseUrl; 
$cs = Yii::app()->getClientScript();
$cs->registerCssFile($baseUrl.'/css/formStyle.css');
?>
<script type="text/javascript">
    jQuery(document).ready(function(){
       jQuery('.customselect').customSelect();
       jQuery('.register_form input[type="text"],.register_form input[type="password"]').focus(function(){
            jQuery(this).parent('p').addClass('pfocus');
       });
       jQuery('.register_form input[type="text"],.register_form input[type="password"]').focusout(function(){
            jQuery(this).parent('p').removeClass('pfocus');
       });
       jQuery('.register_form input[type="text"],.register_form input[type="password"]').mouseover(function(){
            jQuery(this).parent('p').addClass('phover');
       });
       jQuery('.register_form input[type="text"],.register_form input[type="password"]').mouseout(function(){
            jQuery(this).parent('p').removeClass('phover');
       });
    });
    </script>
<style>
    img{
        float: left;
    }
    .errorMessage
    {
      color: red;
    }
</style>
<div class="one_column">
    <?php $form=$this->beginWidget('CActiveForm', array(
     'id'=>'login-form',
     'enableClientValidation'=>true,
     'clientOptions'=>array(
      'validateOnSubmit'=>true,
      ),
     'htmlOptions'=>array(
        'class'=>'content_form register_form',
        'style' => "margin-top: 130px;",
        ),
        )); ?>
        <h2>
            Đăng nhập
        </h2>
            <?php echo $form->error($model,'username'); ?>
            <?php echo $form->error($model,'password'); ?>
        <!-- <p class="note"><?php // echo $model->getAttributeLabel('noteRequired') ?></p> -->
        <p class="input_wrapper">
            <img src="<?php echo Yii::app()->theme->baseUrl; ?>/front/images/icon_reg_user.png" />
            <?php echo $form->textField($model,'username',array('value'=> $model->getAttributeLabel('username'), 'onfocus' => "if (this.value=='Tên đăng nhập'){this.value=''}", 'onblur' => "if (this.value=='') {this.value='Tên đăng nhập'}")); ?>
            
        </p>
        <p class="input_wrapper">
            <img src="<?php echo Yii::app()->theme->baseUrl; ?>/front/images/icon_reg_pass.png" />
            <?php echo $form->passwordField($model,'password',array('value'=> '123456789', 'onfocus' => "if (this.value=='123456789'){this.value=''}", 'onblur' => "if (this.value=='') {this.value='123456789'}")); ?>
            
        </p>
        <p>
            <?php echo CHtml::submitButton('Đăng nhập'); ?>
        </p>
        <?php $this->endWidget(); ?>
</div>
    
